<?php

/**
 * ClassName:帖子
 * @auditor LeiJunXiang
 * @time 2024/10/28
 */

namespace app\model\invite;

use app\factory\Factory;
use app\model\ModelBase;
use app\modelOpreate\invite\Invite;

class InviteModel extends ModelBase
{
    const MODEL_INVITE = "invite";
    //帖子编号
    protected $count;
    //标题
    protected $title;
    //内容
    protected $content;
    //图片链接队列
    protected $pictureLinkList;
    //发贴人id
    protected $publishId;
    //发布时间
    protected $publishTime;
    //点赞人数
    protected $likeNumber;
    //评论数
    protected $commentNumber;
    //观看人数
    protected $viewNumber;
    //所属圈子
    protected $belongCircle;

    //关注用户id对列
    protected $attentionUserIdList;
    //帖子状态
    //0：审核中
    //1：已发布
    //2：未发布
    //3：已下架
    //4：已删除
    protected $status;
    //内容缩略
    protected $contentAbbre;
    //热门权重
    protected $hotWeight;

    public function __construct()
    {
        //默认状态为审核中
        $this->status = 0;
    }

    /**
     * 获取对象实例
     * @return
     */
    static public function getObj(){
        $count = Factory::createUniqueNumber();
        $obj = Factory::getInstance()->getModelObj(InviteModel::MODEL_INVITE,$count);
        $obj->setCount($count);
        return $obj;
    }

    /**
     * （true/false）发布帖子
     */
    public function publishInvite()
    {
        if (empty($this->title) || empty($this->content) || empty($this->publishId)|| empty($this->objKey)) {
            return false;
        }

        $ope = Factory::getInstance()->getToolObj(Invite::TOOL_INVITE_OPE);
        $arr = $this->getAttribute();
        return $ope->insertInvite($arr);
    }


    /**
     * @return mixed
     */
    public function getCount()
    {
        return $this->count;
    }

    /**
     * @param mixed $count
     */
    public function setCount($count): void
    {
        $this->count = $count;
    }

    /**
     * @return mixed
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * @param mixed $title
     */
    public function setTitle($title): void
    {
        $this->title = $title;
    }

    /**
     * @return mixed
     */
    public function getContent()
    {
        return $this->content;
    }

    /**
     * @param mixed $content
     */
    public function setContent($content): void
    {
        $this->content = $content;
    }

    /**
     * @return mixed
     */
    public function getPictureLinkList()
    {
        return $this->pictureLinkList;
    }

    /**
     * @param mixed $pictureLinkList
     */
    public function setPictureLinkList($pictureLinkList): void
    {
        $this->pictureLinkList = $pictureLinkList;
    }

    /**
     * @return mixed
     */
    public function getPublishId()
    {
        return $this->publishId;
    }

    /**
     * @param mixed $publishId
     */
    public function setPublishId($publishId): void
    {
        $this->publishId = $publishId;
    }



    /**
     * @return mixed
     */
    public function getPublishTime()
    {
        return $this->publishTime;
    }

    /**
     * @param mixed $publishTime
     */
    public function setPublishTime($publishTime): void
    {
        $this->publishTime = $publishTime;
    }

    /**
     * @return mixed
     */
    public function getLikeNumber()
    {
        return $this->likeNumber;
    }

    /**
     * @param mixed $likeNumber
     */
    public function setLikeNumber($likeNumber): void
    {
        $this->likeNumber = $likeNumber;
    }

    /**
     * @return mixed
     */
    public function getCommentNumber()
    {
        return $this->commentNumber;
    }

    /**
     * @param mixed $commentNumber
     */
    public function setCommentNumber($commentNumber): void
    {
        $this->commentNumber = $commentNumber;
    }

    /**
     * @return mixed
     */
    public function getViewNumber()
    {
        return $this->viewNumber;
    }

    /**
     * @param mixed $viewNumber
     */
    public function setViewNumber($viewNumber): void
    {
        $this->viewNumber = $viewNumber;
    }

    /**
     * @return mixed
     */
    public function getBelongCircle()
    {
        return $this->belongCircle;
    }

    /**
     * @param mixed $belongCircle
     */
    public function setBelongCircle($belongCircle): void
    {
        $this->belongCircle = $belongCircle;
    }

    /**
     * @return mixed
     */
    public function getAttentionUserIdList()
    {
        return $this->attentionUserIdList;
    }

    /**
     * @param mixed $attentionUserIdList
     */
    public function setAttentionUserIdList($attentionUserIdList): void
    {
        $this->attentionUserIdList = $attentionUserIdList;
    }



    /**
     * @return mixed
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * @param mixed $status
     */
    public function setStatus($status): void
    {
        $this->status = $status;
    }

    /**
     * @return mixed
     */
    public function getContentAbbre()
    {
        return $this->contentAbbre;
    }

    /**
     * @param mixed $contentAbbre
     */
    public function setContentAbbre($contentAbbre): void
    {
        $this->contentAbbre = $contentAbbre;
    }

    /**
     * @return mixed
     */
    public function getHotWeight()
    {
        return $this->hotWeight;
    }

    /**
     * @param mixed $hotWeight
     */
    public function setHotWeight($hotWeight): void
    {
        $this->hotWeight = $hotWeight;
    }



}